<?php
/**
 * Created by DRCOM.
 * User: GZX
 * Datetime: 2022-03-23 13:38
 */

namespace app\api\controller;


class Waimai
{
    //饿了么
    public function eleme(){
        $data = [
            'apkey'       => '6a9ffd88-17a3-9f54-0bb7-b91a81405862',
            'activity_id'      => '10144',
            's_id' => '131415',
        ];
        $url = "http://api.web.ecapi.cn/alsc/getTbkActivityInfo?";

        $params = http_build_query($data);
        $result = file_get_contents($url . $params);
        $content = json_decode($result, true);
        dump($content) ;

    }

    public function meituan(){
        $url = 'http://api.web.ecapi.cn/platform/meituan_v2?apkey=6a9ffd88-17a3-9f54-0bb7-b91a81405862&eid=common';
        $result = file_get_contents($url);
        $content = json_decode($result, true);

        dump($content);
    }
    
    public function mt(){
        $url = 'https://v3.api.haodanku.com/meituan_activity_list?apikey=C985402A2853';
        echo file_get_contents($url);

    }

    //	链接类型：1 h5链接；2 deeplink(唤起)链接；3 中间页唤起链接；4 微信小程序唤起路径（默认1）
    public function mt2(){
        $url = 'http://v3.api.haodanku.com/meituan_ratesurl';
        $data = [
            'apikey'=>'C985402A2853',
            'activity_id'=>'33',
            'link_type'=>$_GET['type']??1,
        ];
        echo file_post_contents($url,$data);

    }

    public function hdk_eleme(){
        $url = 'http://v3.api.haodanku.com/elm_activity_list?apikey=C985402A2853';
        echo file_get_contents($url);


    }

    public function hdk_eleme2(){
        $url = 'https://v3.api.haodanku.com/elm_activity_ratesurl';
        $data = [
            'apikey'=>'C985402A2853',
            'activity_id'=>10144,
            'sid'=>date('Ymd'),
        ];
        echo file_post_contents($url,$data);
        
    }

    public function cps(){

        $url = 'https://v3.api.haodanku.com/hv_ratesurl';
        $data = [
            'apikey'=>'C985402A2853',
            'platform'=>9,
//            'sid'=>date('Ymd'),
        ];
        echo file_post_contents($url,$data);
    }


}